<?php
require_once ("dbconfig.php");
include("include/session.php");
global $database;
$config = $database->getConfigs();?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<link href="styles/style.css" type="text/css" rel="stylesheet" />
<link href="styles/lightbox.css" type="text/css" rel="stylesheet" />
<link href="styles/select2.css" rel="stylesheet" type="text/css" />

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js" type="text/javascript" /></script>
<script src="jscripts/jquery.maskedinput.js" type="text/javascript" /></script>
<script src="jscripts/jquery.lightbox.js" type="text/javascript" /></script>
<script src="jscripts/select2.min.js" type="text/javascript" /></script>
<script src="jscripts/jquery.onload.js" type="text/javascript" /></script>

<title>Anteater Feeder</title>
</head>
<body id="back-layer">
<div id="fore-layer">
<div class="wrapper outer-shadow">
	<div id="header">
    	<div id="logo"><a href="index.php" ><img class="logo" alt="logo" src="images/anteaterfeederlogo.png" ></a></div>
        <div id="login">
			<?php if($session->logged_in) { 
				echo "<li>Welcome <a class='item' href='userinfo.php?user=$session->username' >$session->username</a>!</li>
				<a class='button' href='process.php' >Logout</a>"; }
			else {
				echo "<a class='button' onclick='launch();' >Login | Sign Up</a>"; }?>
		</div>
        <div id="nav">
        	<ul class="group" id="nav_group">
                <?php if($session->logged_in) {
                    if($session->isAdmin()){
                    	echo "<li ";
						if (strpos($_SERVER['PHP_SELF'], '/admin.php')) echo 'class="current"';
						echo "><a class='item' href='admin/main.php'>Admin Center</a></li>";
                    }else if($session->isModerator()){ 
                        $result = mysql_query("SELECT * FROM update_queue WHERE modAction='new'");
                        $total_results = mysql_num_rows($result);
                    	echo "<li><a class='item' href='moderator/moderator.php'>Moderator Center";
                    	if(($total_results > 0)) {
                            echo '<img src="images/icon_notif.png" style=" margin-right:-15px; margin-top:-4px;" />';
                            echo $total_results; }
							echo "</a></li>";
                    	}
					} ?>
            	<li <?php if (strpos($_SERVER['PHP_SELF'], 'food_map.php')) echo 'class="current"';?>><a href="food_map.php" class="item">Food Map</a></li>
            	<li <?php if (strpos($_SERVER['PHP_SELF'], 'index.php')) echo 'class="current"';?>><a href="index.php" class="item">Home</a></li>
            </ul>
        </div>
    </div>